const express = require('express')
const fs = require('fs')
const router = express.Router()

// 获取导航栏数据
router.get('/menulist', (req, res) => {
  fs.readFile('./menuList.json', (err, data) => {
    if (err) {
      return res.status(500).send('Server error.')
    }
    res.send(JSON.parse(data).menuList)
  })
})

module.exports = router
